import http from "./http";

const getAllDepartments = () => {
    const path = "/staff/dapartments";
    return http.get(path);
}
const addStaff =(realname,email,password)=>{
    const path = "/staff/staff";
    return http.post(path,{realname,email,password}); 
}
const getStaffList = (page=1,size=10,params) => {
    const path = "/staff/staff"
    params = params?params:{};
    params['page'] = page
    params['size'] = size
    return http.get(path,params);
}
const updateStaffStatus = (id,status)=>{
    const path = `/staff/staff/${id}`;
    return http.put(path,{status});
}
const downLoadStaffs = (pks) =>{
    const path = "/staff/download";
    return http.downloadFile(path,{'pks':JSON.stringify(pks)});
}
export default {
    getAllDepartments,
    addStaff,
    getStaffList,
    updateStaffStatus,
    downLoadStaffs
}